﻿
Partial Class Dialogos_frmPopUpExistenciaBodegas
    Inherits System.Web.UI.Page
    'Private oDvBodegas As DataView
    'Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    '    If Not Page.IsPostBack Then
    '        Response.Cache.SetCacheability(HttpCacheability.NoCache)
    '        Response.Cache.SetExpires(DateTime.Now().Subtract(New TimeSpan(1, 0, 0)))
    '        Response.Cache.SetLastModified(DateTime.Now)
    '        Response.Cache.SetAllowResponseInBrowserHistory(False)
    '        Session.Timeout = 1000
    '        fnRecuperarValoresURL()
    '        fnCargarGrillaBodega()

    '    End If
    'End Sub

    'Private Sub fnCargarGrillaBodega()
    '    Try
    '        Dim psBodega As String
    '        If Not (txtBodega.Text.Trim.Equals(String.Empty)) Then
    '            psBodega = txtBodega.Text.Trim
    '        Else
    '            psBodega = ""
    '        End If
    '        oDvBodegas = fnCargarDataSet(psBodega).Tables(0).DefaultView
    '        'Cache("oDvBodegas") = oDvBodegas
    '        Session("oDvBodegasEx") = oDvBodegas
    '        EnlazarDatagrid(Me.grdBodegas, oDvBodegas)
    '    Catch ex As Exception
    '        lblMensaje.Text = C_MSG_ERROR_INESPERADO
    '        CreateLogFiles()
    '        ErrorLog(Server.MapPath("Logs/ErrorLog"), ex.Message + ex.StackTrace)

    '    End Try
    'End Sub

    'Private Sub fnRecuperarValoresURL()
    '    If Request.QueryString("Compania") Is Nothing Then
    '        hidCompania.Value = String.Empty
    '    Else
    '        hidCompania.Value = Request.QueryString("Compania")
    '    End If
    '    If Request.QueryString("Articulo") Is Nothing Then
    '        hidArticulo.Value = String.Empty

    '    Else
    '        hidArticulo.Value = Request.QueryString("Articulo")
    '    End If
    '    If Request.QueryString("Bodega") Is Nothing Then
    '        Me.txtBodega.Text = String.Empty
    '    Else
    '        txtBodega.Text = Request.QueryString("Bodega")
    '    End If
    'End Sub


    'Public Sub EnlazarDatagrid(ByVal grd As DataGrid, ByVal oDv As DataView)
    '    grd.DataSource = oDv
    '    grd.DataBind()
    'End Sub
    'Private Function fnCargarDataSet(ByVal psBodega As String) As DataSet

    '    Dim ws As New srvNegExistenciaBodega.srvNegExistenciaBodega
    '    Dim sError As String
    '    Dim bOk As Boolean
    '    Dim oDst As DataSet
    '    bOk = ws.fnListar(1, hidCompania.Value, hidArticulo.Value, psBodega, oDst, sError)
    '    If Not bOk Then
    '        lblMensaje.Text = "Ocurrió un Error al intentar cargar las bodegas, si el problema persiste contacte con soporte."
    '        Exit Function
    '    End If
    '    Return oDst
    'End Function


    'Private Sub grdBodegas_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles grdBodegas.SortCommand
    '    'oDvBodegas = Cache("oDvBodegas")
    '    oDvBodegas = Session("oDvBodegasEx")
    '    If ViewState(e.SortExpression) Is Nothing Then
    '        oDvBodegas.Sort = New System.Text.StringBuilder().Append(e.SortExpression).Append(" asc").ToString
    '    Else
    '        If ViewState(e.SortExpression).Substring(ViewState(e.SortExpression).Length - 3, 3) = "asc" Then
    '            oDvBodegas.Sort = New System.Text.StringBuilder().Append(e.SortExpression).Append(" desc").ToString
    '        Else
    '            oDvBodegas.Sort = New System.Text.StringBuilder().Append(e.SortExpression).Append(" asc").ToString
    '        End If
    '    End If
    '    ViewState(e.SortExpression) = oDvBodegas.Sort
    '    EnlazarDatagrid(Me.grdBodegas, oDvBodegas)
    'End Sub

    'Private Sub grdBodegas_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles grdBodegas.PageIndexChanged
    '    'oDvBodegas = Cache("oDvBodegas")
    '    oDvBodegas = Session("oDvBodegasEx")
    '    Me.grdBodegas.CurrentPageIndex = e.NewPageIndex
    '    EnlazarDatagrid(grdBodegas, oDvBodegas)
    'End Sub

    'Private Sub fnCargarBodega()
    '    Dim psBodega As String
    '    If Not (txtBodega.Text.Trim.Equals(String.Empty)) Then
    '        psBodega = txtBodega.Text.Trim
    '    Else
    '        psBodega = ""
    '    End If
    '    Me.oDvBodegas = fnCargarDataSet(psBodega).Tables(0).DefaultView
    '    'Cache("oDvBodegas") = oDvBodegas
    '    Session("oDvBodegasEx") = oDvBodegas
    '    EnlazarDatagrid(Me.grdBodegas, oDvBodegas)
    'End Sub
    'Private Sub btnBuscar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBuscar.Click
    '    fnCargarBodega()
    'End Sub
End Class
